<div class="titlebar"><i class="iconfont icon-calendar_icon"></i><span class="fn-fb">[{$info.name}] 订单数据</span></div>
<div class="titlebar fn-clear">
    <div class="fn-left"><i class="iconfont icon-my_icon"></i><span class="fn-fb">好店员工</span> <span class="gray fn-f12">选择员工后,将改变用户的所属好店,删除后用户将取消和所有店铺关系绑定。</span></div>
    <div class="fn-right">
        {if empty($manage)}
        <a href="{:url('store.index/edit',['id' => $info->id])}" class="button button-green"><i class="iconfont icon-add_icon"></i>设置主管理员</a>
        {else}
        <a href="javascript:;" url="{:url('store.index/winUser',['store_id' => $info->id])}" class="button button-blue win"><i class="iconfont icon-add_icon"></i>选择员工</a>
        {/if}
    </div>
</div>
<table class="table table-border">
    <thead>
    <tr>
        <th class="w80 fn-tac">#</th>
        <th class="w90 fn-tac">操作</th>
        <th class="w80 fn-tac">邀请码</th>
        <th class="w150">手机号</th>
        <th class="w80 fn-tac"></th>
        <th>微信昵称</th>
    </tr>
    </thead>
    <tbody>
    {if !empty($manage)}
    <tr>
        <td class="fn-tac"><span class="badge bg-red">老板</span></td>
        <td><a class="button button-disabled" href="javascript:;"><i class="iconfont icon-lajixiang"></i>删除</a></td>
        <td class="fn-tac">{$manage->invite_code}</td>
        <td>{$manage->phone_uid}</td>
        <td class="fn-tac"><img src="{$manage.face}" class="w40" /></td>
        <td><a href="javascript:openwin('{:url('user/review',['uid' => $manage.id])}')">{$manage->nickname}</a></td>
    </tr>
    {/if}
    {foreach $user as $vo}
    <tr>
        <td class="fn-tac">
            <a class="istop" url="{:url('store.index/isCashier',array('id' => $vo.id))}" href="javascript:;" title="设置管理员/员工">
                {if $vo.is_cashier}<span class="badge bg-blue">管理员</span>{else}<span class="badge">员工</span>{/if}
            </a>
        </td>
        <td><a class="button isDel" url="{:url('store.index/delUser',['id' => $vo.user.id])}" href="javascript:;"><i class="iconfont icon-lajixiang"></i>删除</a></td>
        <td class="fn-tac">{$vo->user->invite_code}</td>
        <td>{$vo->user->phone_uid}</td>
        <td class="fn-tac"><img src="{$vo.user.face}" class="w40" /></td>
        <td><a href="javascript:openwin('{:url('user/review',['uid' => $vo.user.id])}')">{$vo->user->nickname}</a></td>
    </tr>
    {/foreach}
    </tbody>
</table>
<table class="table">
    <thead>
        <tr>
            <th>平台单号</th>
            <th class="w140">创建时间</th>
            <th class="w140">付款时间</th>
            <th class="w100 fn-tar">￥计付</th>
            <th class="w100 fn-tar">￥优惠</th>
            <th class="w100 fn-tar">￥应收</th>
        </tr>
    </thead>
    <tbody>
        {foreach $orders as $vo}
        <tr>
            <td>
                <a href="javascript:openwin('{:url('queen/index',['order' => $vo.order_no])}')">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gongzuorizhi"></use></svg> {$vo.order_no}<br />
                    <svg class="icon" aria-hidden="true"><use xlink:href="#icon-wechat"></use></svg> {$vo.paid_no}
                </a>
            </td>
            <td>{$vo.update_time|date='Y-m-d H:i'}</td>
            <td>{$vo.paid_time|date='Y-m-d H:i'}</td>
            <td class="fn-tar">￥{$vo.amount}</td>
            <td class="fn-tar">￥{:money($vo.amount - $vo.price)}</td>
            <td class="fn-tar">￥{$vo.price}</td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$orders|raw}
<style type="text/css">
    .counts{display: flex;}
    .counts .box{flex: 1;background: #efefef;margin: 10px;padding: 20px;color: #333;border-left:2px solid #2d8cf0;}
    .counts .box:first-child{margin-left: 0px;}
    .counts .box:last-child{margin-right: 0px;}
    .counts .box .iconfont{font-size:40px;}
    .counts .box .num{font-size:25px;}
    .counts .box .text{font-size:14px;}
</style>
<script type="text/javascript">
Do('base','layer', function () {
    $('.isDel').isDel();
    $(".win").win({reload:1});
    $('.istop').click(function () {
        var url = $(this).attr("url");
        parent.layer.confirm('确认要改变用户身份?',{ icon: 3,title: '友情提示' }, function (index) {
            $.getJSON(url, function (data) {window.location.reload();});
            parent.layer.close(index);
        });
    })
})
</script>